﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SmartSpace.Core;
using SmartSapce.ServiceLocation;

namespace SmartSpace.WebApp._console.core
{
    public partial class image_preview : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid id = new Guid(Request.QueryString["id"]);
            ICoreService service = ServiceLocator.Get<ICoreService>();
            ImageFile image = service.GetImage(id);
            Response.ContentType = "image/png";
            Response.BinaryWrite(image.Data);
        }
    }
}